<template>
  <div>
    <div class="asd">
      <h1>热门歌单推荐</h1>
    </div>
    <ul>
      <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
        <li v-for="(item, index) in list" :key="index">
          <!-- {{ item.creator.name }} -->
          <div><img :src="item.imgurl" alt="" /></div>
          <div>
            <h3>
              {{ item.creator.name }}
            </h3>
            <p>{{ item.dissname }}</p>
          </div>
        </li>
        <!-- <van-cell v-for="item in list" :key="item" :title="item" /> -->
      </van-pull-refresh>
    </ul>
  </div>
</template>
<script>
import service from "./service";
import { Toast } from "vant";

export default {
  data() {
    return {
      list: [],
      loading: false,
      finished: false,
      refreshing: false,
      count: 0,
      isLoading: false,
    };
  },
  methods: {
    onRefresh() {
      setTimeout(() => {
        Toast("刷新成功");
        this.isLoading = false;
        this.count++;
      }, 1000);
    },
  },
  async created() {
    const result = await service.getBanner();
    this.list = result.data.list;
    console.log(result.data.list);
  },
};
</script>

<style lang="less" scoped>
@import "../../../style/index.less";
.asd {
  .w(375);
  .h(65);
  background: black;
  color: gold;
  text-align: center;
  padding-top: 5rem;
  font-size: 2rem;
}
ul {
  background: black;
}
li {
  padding: 0 6rem 5rem 6rem;
  .h(82);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
li img {
  .w(60);
  .h(60);
  margin-left: 3rem;
  margin-right: 8rem;
}
h3 {
  color: azure;
  margin-bottom: 2rem;
}
li p {
  color: antiquewhite;
}
</style>
